package com.example.demo.testOne;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @description 数组
 *
 * @author lilinchun
 * @date 2023/11/29
 */
public class demo13 {


    public static void main(String[] args) {
      String image="https://p3-sign.toutiaoimg.com/tos-cn-i-axegupay5k/22b7e90d469f40ef84eda2efa42abb3f~noop.image?_iz=58558&from=article.pc_detail&lk3s=953192f4&x-expires=1701845941&x-signature=xfdaZLtISw5KpPU05VewZVAiihE%3D,";
        String[] split = image.split(",");
        List<String> myList = Arrays.stream(split).collect(Collectors.toList());
        // 发布点点最多9张
        if (myList.size() > 9) {
            String img = myList.get(0);
            for (int i = 1; i < 9; i++) {
                img = img + "," + myList.get(i);
            }
            System.out.println(img);
        } else {
            String collect = String.join(",", myList);
            System.out.println(collect);
        }

    }
}
